Skip to content

Conversation

@xingliu14
Copy link
Collaborator

@xingliu14 xingliu14 commented Nov 21, 2025

Description

Centralizes environment variable access by routing following environment variable reads through the envs.py module.

  • SKIP_JAX_PRECOMPILE
  • VLLM_XLA_CHECK_RECOMPILATION
  • MODEL_IMPL_TYPE
  • NEW_MODEL_DESIGN
  • PHASED_PROFILING_DIR
  • PYTHON_TRACER_LEVEL
  • USE_MOE_EP_KERNEL
  • NUM_SLICES
  • RAY_USAGE_STATS_ENABLED
  • VLLM_USE_RAY_COMPILED_DAG_CHANNEL_TYPE

Addressing #1016.

Tests

pytest

tests/runner/test_utils.py
tests/worker/tpu_worker_test.py
tests/runner/test_tpu_runner.py
tests/layers/common/test_attention_interface.py
tests/executors/test_ray_distributed_executor.py
tests/runner/test_tpu_runner_mesh.py
tests/test_envs.py

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

@xingliu14 xingliu14 marked this pull request as draft November 21, 2025 05:33
@xingliu14 xingliu14 force-pushed the env_var branch 4 times, most recently from 4df238b to 2c92d5d Compare November 21, 2025 07:04
@xingliu14 xingliu14 marked this pull request as ready for review November 21, 2025 07:08
@xingliu14
Copy link
Collaborator Author

@kyuyeunk It's ready for review.

if __name__ == "__main__":
# Skip long warmup for local simple test.
os.environ['SKIP_JAX_PRECOMPILE'] = '1'
envs.environment_variables['SKIP_JAX_PRECOMPILE'] = lambda: True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unintuitive way to specify environment variable within unit tests.

does something like envs.SKIP_JAX_PRECOMPILE = True not work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no setattr to write the variable. Actually the best to rewrite is setting the environ direcly. I have reverted the changes along with other similar changes.

from vllm.v1.executor.ray_executor import RayWorkerMetaData
from vllm.v1.executor.ray_utils import RayWorkerWrapper, _wait_until_pg_ready

import tpu_inference.envs as tpu_envs
Copy link
Collaborator

@kyuyeunk kyuyeunk Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other files just use envs for tpu_inference.envs and reword vllm.envs as vllm_envs. what is the rationale for doing it differently here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake, and actually I reverted the file change since it's var setting instead of reading.

Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Signed-off-by: Xing Liu <xingliu14@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants